/*******************************************************************************
 * Package: com.hngtrust.iir.user.controller
 * Type:    FunctionsController
 * Date:    2021-4-20 10:03
 *
 * Copyright (c) 2021 HUANENG GUICHENG TRUST CORP.,LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.hngtrust.iir.user.controller;

import com.hngtrust.framework.bind.ResponseInfo;
import com.hngtrust.iir.user.entity.Functions;
import com.hngtrust.iir.user.service.FunctionsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 功能菜单
 * @author Chentianyong
 * @date 2021-4-20 10:03
 */
@Slf4j
@Api(tags = "功能菜单")
@RestController
@RequestMapping("/func")
public class FunctionsController {
    
    @Autowired
    private FunctionsService functionsService;
    
    /**
     * 功能菜单列表
     */
    @ApiOperation(value = "功能菜单列表", notes = "功能菜单列表")
    @PostMapping("/list-func")
    public ResponseInfo<List<Functions>> listFunc(
            @ApiParam(value = "功能菜单列表") @Valid @RequestBody Functions req) {
        log.info("FunctionsController.listFunc start...");

        List<Functions> list = functionsService.queryList(req);
        
        ResponseInfo<List<Functions>> data = new ResponseInfo<>();
        data.setData(list);
        return data;
    }
}
